package com.example.video;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        Intent intent = getIntent();
        String link = intent.getStringExtra("link");
        VideoView view = findViewById(R.id.videoView);
        view.setVideoURI(Uri.parse(link));
        view.start();
        MediaController controller = new MediaController(this);
        view.setMediaController(controller);
    }
}